package cn.amoqi.springboot.validator.model;

import cn.amoqi.springboot.validator.valid.FlagValidator;
import lombok.Data;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.*;
import java.util.List;

@Data
public class Student {
    @NotBlank(message = "姓名不能为空")
    private String name;
    @NotNull(message = "地址不能为NULL")
    private String address;
    @Min(value = 0,message = "不能小于0")
    private Integer age;
    @AssertTrue(message = "该项必须为true")
    private Boolean isStudent;
    @Email(message = "不符合有效规则")
    private String email;
    @NotEmpty
    private List<String> not;
    /**
     * 这个是自定义错误设置
     */
    @FlagValidator(value = {"0","1"}, message = "学生的状态不正确")
    private Integer studentStatus;
}
